package com.group11.base.controller;

import com.group11.base.entity.Region;
import com.group11.base.service.RegionService;
import com.group11.common.pojo.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("region")
public class RegionController {
    @Autowired
    private RegionService regionService;

    @PostMapping("list")
    public ResponseResult<List<Region>> list(@RequestBody(required = false) Region region) {
        return new ResponseResult<>(regionService.list(region));
    }

}
